﻿@model List<HugMe.Bussiness.Model.vk.Person>

@{
    ViewBag.Title = "ViewMessages";
}

<script type="text/javascript">
	jQuery(function($) {
		$('a.approve').on('click', function(e) {
			e.preventDefault();

			var $link = $(this);
			
			$.ajax({
				type: 'GET',
				url: $link.attr('href'),
				dataType: 'json',
				success: function (data) {
					$link.closest('tr').remove();
				}
			});
		});
	})
</script>

<h2>Согласны переспать</h2>
<table class="table table-striped">
	<tbody>
		@foreach (var person in Model)
		{
			<tr>
				<td><img src="@person.PhotoUrlSmall"/></td>
				<td>@person.FirstName @person.LastName</td>
				<td>@Html.ActionLink("Теперь я в курсе :-)", "Approve", "Vk", new {partnerId = person.UserId}, new { @class = "approve"})</td>
			</tr>
		}
	</tbody>

</table>

@section footer
{
	@Html.ActionLink("Вернуться", "Index", "Vk")
}
